/**
 * 公共的分页返回类型封装
 */
export type IPage<T> = {
  length: number;
  list: T[];
  count: number;
};

/**
 * 公共的请求分页参数
 */
export type IPageParams = {
  limit: number;
  page: number;
};

export type Error = {
  code: number;
  message: string;
};

/**
 * 向外暴露表单的保存和修改
 */
export type IFormRef = {
  save: () => void;
  update: () => void;
  reset?: () => void;
};

/**向外暴露的重置,填充接口 */
export type IRoleRestFillRefHandler = {
  rest: () => void;
  fill: (sysRoleId: number) => void;
  getData?: () => { value: string; name: string };
};

/**表格选中 */
export type IChekedTable = {
  selectKeys: string[];
  checkedAll: boolean;
  unSelectKeys: string[];
};

/**
 * 富文本的数据
 */
export type IEditRef = {
  getData: () => string | undefined;
};

/**
 * 上次文件
 */
export type ILawsRef = {
  rest: () => void;
  fill: (str: string) => void;
  getData: () => string | undefined;
};

/**
 * select 
 */
export type ISelectMutiRef = {
  rest: () => void;
  fill: (str: string[]) => void;
  getData: () => string[] | undefined;
};

/**
 * 附件类型
 */

export type IAttachment = {
  /**
   * 附件ID
   */
  attatchmentId: number;
  /**
   * 附件地址
   */
  attachmentUrl: string;

  /**
   * 附件名称
   */
  attachmentName: string;

  /**
   * 关联ID
   */
  sourceId: string;
};
